package com.hotel.hotelsystem.controller;

import com.hotel.hotelsystem.pojo.HotelList;
import com.hotel.hotelsystem.service.HotelIndexRankingListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hotelIndex")
public class HotelIndexRankingListController {

    @Autowired
    private HotelIndexRankingListService hotelIndexRankingListService;

    @GetMapping("/rankingList")
    public List<HotelList> rankingList(){
        //展示前多少名
        int num = 3;
        List<HotelList> hotelLists = hotelIndexRankingListService.rankingList(num);
        return hotelLists;
    }

}
